ninab416 2.2.1
Loading...
Searching...
No Matches
ninab416.h File Reference

This file contains API for NINA-B416 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  ninab416_t
 NINA-B416 Click context object. More...
struct  ninab416_cfg_t
 NINA-B416 Click configuration object. More...

Macros

#define NINAB416_CMD_AT   "AT"
 NINA-B416 control commands.
#define NINAB416_CMD_GET_MODEL_ID   "AT+CGMM"
#define NINAB416_CMD_GET_SW_VERSION   "AT+CGMR"
#define NINAB416_CMD_GET_SERIAL_NUM   "AT+CGSN"
#define NINAB416_CMD_FACTORY_RESET   "AT+UFACTORY"
#define NINAB416_CMD_REBOOT_DEVICE   "AT+CPWROFF"
#define NINAB416_CMD_BT_LOCAL_NAME   "AT+UBTLN"
#define NINAB416_CMD_CONNECT_PEER   "AT+UDCP"
#define NINAB416_CMD_WRITE_DATA   "AT+UDATW"
#define NINAB416_CMD_READ_DATA   "AT+UDATR"
#define NINAB416_CMD_CLOSE_PEER   "AT+UDCPC"
#define NINAB416_CMD_ENTER_DATA_MODE   "ATO1"
#define NINAB416_CMD_ENTER_CMD_MODE   "+++"
#define NINAB416_RSP_OK   "OK"
 NINA-B416 device response to AT commands.
#define NINAB416_RSP_ERROR   "ERROR"
#define NINAB416_URC_GREETING   "+STARTUP"
 NINA-B416 device unsolicited response code (URC) settings.
#define NINAB416_URC_PEER_CONNECTED   "+UUDPC:"
#define NINAB416_URC_PEER_DISCONNECTED   "+UUDPD:"
#define NINAB416_URC_READ_SOCKET_DATA   "+UUDATA:"
#define NINAB416_TX_DRV_BUFFER_SIZE   200
 NINA-B416 driver buffer size.
#define NINAB416_RX_DRV_BUFFER_SIZE   600
#define NINAB416_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  ninab416_return_value_t { NINAB416_OK = 0 , NINAB416_ERROR = -1 , NINAB416_ERROR_TIMEOUT = -2 , NINAB416_ERROR_CMD = -3 }
 NINA-B416 Click return value data. More...

Functions

void ninab416_cfg_setup (ninab416_cfg_t *cfg)
 NINA-B416 configuration object setup function.
err_t ninab416_init (ninab416_t *ctx, ninab416_cfg_t *cfg)
 NINA-B416 initialization function.
err_t ninab416_generic_write (ninab416_t *ctx, uint8_t *data_in, uint16_t len)
 NINA-B416 data writing function.
err_t ninab416_generic_read (ninab416_t *ctx, uint8_t *data_out, uint16_t len)
 NINA-B416 data reading function.
void ninab416_set_rst_pin (ninab416_t *ctx, uint8_t state)
 NINA-B416 set RST pin function.
void ninab416_reset_device (ninab416_t *ctx)
 NINA-B416 reset device function.
void ninab416_set_cts_pin (ninab416_t *ctx, uint8_t state)
 NINA-B416 set CTS pin function.
uint8_t ninab416_get_rts_pin (ninab416_t *ctx)
 NINA-B416 get RTS pin function.
void ninab416_set_dsr_pin (ninab416_t *ctx, uint8_t state)
 NINA-B416 set DSR pin function.
uint8_t ninab416_get_dtr_pin (ninab416_t *ctx)
 NINA-B416 get DTR pin function.
void ninab416_cmd_run (ninab416_t *ctx, uint8_t *cmd)
 NINA-B416 cmd run function.
void ninab416_cmd_set (ninab416_t *ctx, uint8_t *cmd, uint8_t *value)
 NINA-B416 cmd set function.
void ninab416_cmd_get (ninab416_t *ctx, uint8_t *cmd)
 NINA-B416 cmd get function.

Detailed Description

This file contains API for NINA-B416 Click Driver.

Enumeration Type Documentation

◆ ninab416_return_value_t

NINA-B416 Click return value data.

Predefined enum values for driver return values.

Enumerator
NINAB416_OK 
NINAB416_ERROR 
NINAB416_ERROR_TIMEOUT 
NINAB416_ERROR_CMD